import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
// import "./assets/fonts/iconfont.css"

import "amfe-flexible";
import "swiper/swiper.min.css"
// import 'swiper/swiper.min.css'
import axios from "axios"
import Cookie from "js-cookie"
import qs from 'qs'

// 引入宫格组件
import { Grid, GridItem } from 'vant';
// 引入轮播组件
import { Swipe, SwipeItem } from 'vant';
import { Toast } from 'vant';
import animated from 'animate.css'




Vue.config.productionTip = false
Vue.prototype.$axios = axios;
Vue.prototype.$cookie = Cookie;
Vue.prototype.$qs = qs;
Vue.prototype.load = new Vue;

Vue.use(animated)
Vue.use(Swipe).use(SwipeItem);
Vue.use(Toast);
Vue.use(Grid);
Vue.use(GridItem);


Vue.filter('setimgurl', function (value) {
  if (!value) {
    return
  }
  var y;
  let c = value.split("")
  let head = c[0] + "/" + c[1] + c[2] + "/"
  let d = value.split(/(jpeg)|(png)/)
  for (var i = 0; i < d.length; i++) {
    if (d[i] == "jpeg") {
      y = value +"."+ d[i]
    } else if (d[i] == "png") {
      //  y=	value.replace(d[i], "."+d[i])
      y = value +"."+ d[i]
    }
  }

  let values = y.substr(3);
  values = head + values;
  return "https://fuss10.elemecdn.com/" + values;
})


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
